import { getAddress, delAddress, editAddress, addAddress } from '@/api/api.js'
export default {
	state: {
		addressList: [], //用户收获地址
	},
	mutations: {
		setAddressList(state,data) {
			state.addressList = data
		}
	},
	actions: {
		getAddress({commit,state},user_id) {
			return new Promise((resolve,reject)=>{ 
				getAddress({page:1,pageSize:20,user_id}).then(res=>{
					let data = res.result.data
					commit('setAddressList',data)
					resolve(data)
				})
			})
			
		},
		delAddress({commit,state},reslut) {
			
		},
		addAddress({commit,state},reslut) {
			
		},
		editAddress({commit,state},reslut) {
			
		}
	}
}